<?php

namespace App\Services\Home;


use App\Models\Findhouse;
use App\Models\Showings;

class MessageService
{
    public function saveFindHouseInfo($data)
    {
        $res = Findhouse::create($data);
        if($res){
            return response()->json([
                'code' => 0,
                'msg' => '提交成功'
            ]);
        }else{
            return response()->json([
                'code' => 1,
                'msg' => '提交失败，请稍后再试'
            ]);
        }
    }

    public function saveViewHouseInfo($data)
    {
        $res = Showings::create($data);
        if($res){
            return response()->json([
                'code' => 0,
                'msg' => '预约成功'
            ]);
        }else{
            return response()->json([
                'code' => 1,
                'msg' => '预约失败，请稍后再试'
            ]);
        }
    }
}